# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=google-streetview
pkgname=('python2-google-streetview' 'python-google-streetview')
_pkgname=google_streetview
pkgver=1.2.9
pkgrel=9
pkgdesc='A command line tool and module for Google Street View Image API.'
arch=('any')
groups=('blackarch' 'blackarch-misc')
url='https://pypi.org/project/google-streetview/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f0ce6c282377081fd24878d04f0b6d4dcc5a596d47ab19c1a00aa05647b5d06f3689941e50e49ba9b066942890d130acefaac044c58e879df96f414fb5ca601f')

prepare() {
  cp -a "$_pkgname-$pkgver" "$_pkgname-$pkgver-2"
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-google-streetview() {
  depends=('python2' 'python2-requests' 'python2-kwconfig')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${pkgbase}2"
}

package_python-google-streetview() {
  depends=('python' 'python-requests' 'python-kwconfig')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/$pkgbase"
}

